package com.zyd.blog.persistence.mapper;


import com.zyd.blog.persistence.beans.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liusongqi
 * @since 2020-02-27
 */
@Repository
public interface SoftProductMapper extends BaseMapper<SoftProduct> {
    List<SoftNew> soft(@Param(value = "userId") String userId,int page,int count);



    /**    根据规则 变换 获取软装产品
     *      region 0省  1 市  2区  3全国  4 全省  5 全市
     *      sort  19智能排序  20 时间优先 21 点赞优先  22 热度优先
     *      style 只要不为空 直接传过去 就可
     */
    List<SoftNew> sort(@Param(value = "region") String region, @Param(value = "sort") String sort, @Param(value = "style") String style
            ,@Param(value = "province")String province,@Param(value = "city")String city,@Param(value = "area")String area,@Param(value = "userId") String userId,
                       String place,int page,int count);
    Integer topCount(@Param(value = "region") String region, @Param(value = "sort") String sort, @Param(value = "style") String style
            ,@Param(value = "province")String province,@Param(value = "city")String city,@Param(value = "area")String area,@Param(value = "userId") String userId,String place
    );
    Integer count(@Param(value = "region") String region, @Param(value = "sort") String sort, @Param(value = "style") String style
            ,@Param(value = "province")String province,@Param(value = "city")String city,@Param(value = "area")String area,@Param(value = "userId") String userId,
                       String place,int page,int count);
    Integer fabulous(@Param(value = "id") String id);
    List<SoftNew> searchDesign(String value,@Param(value = "userId") String userId,int page,int count);
    Integer searchCount(String value);
    Integer searchCountAll(String value);
    Integer reduceZan(@Param(value = "softId") String softId);

    Integer addCollection(@Param(value = "id") String id);

    Integer deleteCollection(@Param(value = "id") String id);
    void userCount(String id);
    List<SoftProduct> recommendArticle(@Param(value = "softStyle")String softStyle, @Param(value = "softPlace")String softPlace);

    SoftNew specific(@Param(value = "softId") String softId, @Param(value = "userId") String userId);
    Integer commentNum(@Param(value = "designId") String designId);
    Integer commentReduce(@Param(value = "designId") String designId);
    List<ProductNew> product( @Param(value = "id") String id);

    List<ProductNew> index(String userId,int page,int count);


    Integer stopUser(String userId);

    Integer passUser(String userId);
}
